package com.wanxi.service.impl;

import com.wanxi.dao.CustomizeDao;
import com.wanxi.model.CustomizeModel;
import com.wanxi.model.ResultModel;
import com.wanxi.service.CustomizeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 杨金乾
 */
@Service
public class CustomizeServiceImpl implements CustomizeService {
    @Autowired
    CustomizeDao customizeDao;
    @Override
    public ResultModel enable(CustomizeModel customizeModel) {
        return null;
    }

    @Override
    public ResultModel add(CustomizeModel customizeModel) {
        return null;
    }

    @Override
    public ResultModel update(CustomizeModel customizeModel) {
        return ResultModel.getResult(customizeDao.update(customizeModel));
    }

    @Override
    public ResultModel delete(CustomizeModel customizeModel) {
        return null;
    }

    @Override
    public ResultModel findById(CustomizeModel customizeModel) {
        return ResultModel.getResult(customizeDao.findById(customizeModel));
    }

    @Override
    public ResultModel findAll(CustomizeModel customizeModel) {
        customizeModel.setLimit(10);
        customizeModel.setPage((customizeModel.getPage()-1)*10);
        return ResultModel.getResult(customizeDao.findAll(customizeModel),customizeDao.count(customizeModel));
    }

    @Override
    public ResultModel count(CustomizeModel customizeModel) {
        return ResultModel.getResult(customizeDao.count(customizeModel));
    }

    @Override
    public ResultModel isShow(CustomizeModel customizeModel) {
        return ResultModel.getResult(customizeDao.isShow(customizeModel));
    }

    @Override
    public ResultModel isRecommend(CustomizeModel customizeModel) {
        return null;
    }

    @Override
    public ResultModel whereShow(CustomizeModel customizeModel) {
        return null;
    }
}
